PDF Plugin for Xojo

Page.MeasureText Method (console safe)

Measures how many letters of text can fit in a given horizontal space using current font settings. This variation can also get physical width of the text through the outWidth ByRef parameter.

MeasureText(
   text as String,
   width as Single,
   wordWrap as Boolean,
   ByRef outWidth as Single) as Integer

Parameters

text
The text to measure.
width
Width of the area to allow the text to flow in.
wordWrap
If this parameter is true then if considering this text: "Some long text" where we only have space for "Some long t" then it will cut off the last t and space and return 9 instead of 11
outWidth (ByRef parameter)
Real with of the text. (ByRef parameter)

Returns

Integer
The number of letters that can fit within the given space with the current settings.

Remarks

See Also

Page Class